﻿<!-- #include file="Admin_Include.asp" -->
<%
dim ok
if right(gPath,1)<>"/" Then gPath=gPath&"/"
sTemp=procCheckDir(gPath,1)
if sTemp<>"ok" Then
	HtmEnd sTemp,1,""
end if
select case gAct
case "renf"
	procRename()
case "rend"
	procRenameDir()
case "md"
	procMakeDir()
case "copy"
	procDoIt()
case "cut"
	procDoIt()
case "paste" 
	procPaste()
case "del"
	procDel() 
case "delit"
	procDelIt()
case "delitd"
	procDelItD() 
end select
set gFolder=Fso.GetFolder(Server.mappath(gPath))

function procDelIt()
	dim sFile,act
	sFile=getVar("file","str","")
	if sFile="" Then htmEnd "文件不存在",1,""
	act=procCheckFile(gPath&sFile,1)
	if act<>"ok" Then htmEnd act,1,""
	Fso.DeleteFile Server.mappath(gPath&sFile)
end function

function procDelItD()
	dim sFile,act
	sFile=getVar("file","str","")
	if sFile="" Then htmEnd "目录不存在",1,""
	act=procCheckDir(gPath&sFile,1)
	if act<>"ok" Then htmEnd act,1,""
	Fso.DeleteFolder Server.mappath(gPath&sFile)
end function

function procDel()
	dim sStr,maxdir,maxfile,i,ret
	maxdir=cint(Request.Form("maxdir"))
	maxfile=cint(Request.Form("maxfile"))
	for i=1 to maxdir
		if Request.Form("chidd"&i)<>"" Then
			sStr=Request.Form("chidd"&i)
			ret=procCheckDir(gPath&sStr,1)
			if ret<>"ok" Then htmEnd ret,1,""
			Fso.DeleteFolder Server.MapPath(gPath&sStr),true
		end if
	next
	
	sStr=gAct&"|"&gPath
	for i=1 to maxfile
		if Request.Form("chidf"&i)<>"" Then
			sStr=Request.Form("chidf"&i)
			ret=procCheckfile(gPath&sStr,1)
			if ret<>"ok" Then htmEnd ret,1,""
			Fso.DeleteFile Server.MapPath(gPath&sStr),true
		end if
	next
	
	Session("bufferdir")=""
	Session("bufferfile")=""
end Function

function procpaste()
	dim sStr,sStr1,i,ret,sArr
	if Session("bufferdir")="" and Session("bufferfile")="" Then exit function
	sArr=split(Session("bufferdir"),"|")
	if sArr(1)=gPath Then  HtmEnd "不能自己覆盖自己!",1,""
	for i=2 to ubound(sArr)
		sStr=sArr(1)&sArr(i)
		sStr1=gPath&sArr(i)
		if Fso.FolderExists(Server.MapPath(sStr1)) Then htmEnd "目录:"&sStr1&" 已经存在!",1,""
		if procCheckDir(sStr,1)="ok" Then
			if sArr(0)="cut" Then
				Fso.MoveFolder Server.MapPath(sStr),Server.MapPath(sStr1)
			else
				Fso.CopyFolder Server.MapPath(sStr),Server.MapPath(sStr1)
			end if
		end if
	next
	
	sArr=split(Session("bufferfile"),"|")
	for i=2 to ubound(sArr)
		sStr=sArr(1)&sArr(i)
		sStr1=gPath&sArr(i)
		if procCheckFile(sStr,1)="ok" Then
			if sArr(0)="cut" Then
				if Fso.FileExists(Server.MapPath(sStr1)) Then htmEnd "文件 "&sStr1&" 已经存在!",1,""
				Fso.MoveFile Server.MapPath(sStr),Server.MapPath(sStr1)
			else
				Fso.CopyFile Server.MapPath(sStr),Server.MapPath(sStr1),true
			end if
		end if
	next
	Session("bufferdir")=""
	Session("bufferfile")=""
end Function

function procRename()
	dim sFrom,sTo,sStr,sObj
	sFrom=getVar("from","str","") 
	sTo=getVar("to","str","")
	if sFrom="" or sTo="" Then exit function
	sStr=procCheckFile(gPath&sFrom,1)
	if sStr<>"ok" Then  htmEnd sStr,1,""
	sStr=procCheckFile(sTo,0)
	if sStr<>"ok" Then  htmEnd sStr,1,""
	if Fso.FileExists(Server.MapPath(gPath&sTo)) Then HtmEnd "目标文件已存在!",1,""
	set sObj=Fso.GetFile(Server.MapPath(gPath&sFrom))
	sObj.Move Server.MapPath(gPath&sTo)
	set sObj=nothing
end function

function procDoIt()
	dim sStr,maxdir,maxfile,i
	sStr=gAct&"|"&gPath
	maxdir=cint(Request.Form("maxdir"))
	maxfile=cint(Request.Form("maxfile"))
	for i=1 to maxdir
		if Request.Form("chidd"&i)<>"" Then sStr=sStr&"|"&Request.Form("chidd"&i)
	next
	Session("bufferdir")=sStr
	
	sStr=gAct&"|"&gPath
	for i=1 to maxfile
		if Request.Form("chidf"&i)<>"" Then sStr=sStr&"|"&Request.Form("chidf"&i)
	next
	Session("bufferfile")=sStr
end Function

function procMakeDir()
	dim sTo,sStr
	sTo=getVar("to","str","")
	sStr=left(sStr,inStrRev(sStr,"/"))
	sStr=procCheckDir(gPath,1)
	if sStr<>"ok" Then htmEnd sStr,1,""
	sStr=procCheckDir(gPath&sTo,0)
	if sStr<>"ok" Then htmEnd sStr,1,""
	if Fso.FolderExists(Server.mappath(gPath&sTo)) Then htmEnd "目录已经存在!",1,""
	Fso.CreateFolder(Server.mappath(gPath&sTo))
end function

function procRenameDir()
	dim sFrom,sTo,sStr,sObj
	sFrom=getVar("from","str","") 
	sTo=getVar("to","str","")
	if sFrom="" or sTo="" Then exit function
	sStr=procCheckDir(gPath&sFrom,1)
	if sStr<>"ok" Then  htmEnd sStr,1,""
	sStr=procCheckdir(gPath&sTo,0)
	if sStr<>"ok" Then  htmEnd sStr,1,""
	if Fso.FolderExists(Server.MapPath(gPath&sTo)) Then HtmEnd "目标目录已存在!",1,""
	Fso.MoveFolder Server.MapPath(gPath&sFrom),Server.MapPath(gPath&sTo)
	set sObj=nothing
end function

Response.Write "<!DOCTYPE html>" & vbCrLf
Response.Write "<head>" & vbCrLf
Response.Write "<title>Web Edit</title>" & vbCrlf
Response.Write "<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>" & vbCrLf
Response.Write "<meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1'>" & vbCrLf
Response.Write "<meta name='apple-mobile-web-app-status-bar-style' content='black'>" & vbCrLf
Response.Write "<meta name='apple-mobile-web-app-capable' content='yes'>" & vbCrLf
Response.Write "<meta name='format-detection' content='telephone=no'>" & vbCrLf
Response.Write "<link rel=""stylesheet"" type=""text/css"" href=""../fonts/font-awesome/css/font-awesome.min.css"" />" & vbCrLf
Response.Write "<link href='../Plugins/layui/css/layui.css' rel='stylesheet' type='text/css' />" & vbCrLf
Response.Write "<link rel=""stylesheet"" href=""../Style/global.css"" media=""all"">" & vbCrLf
Response.Write "<link rel=""stylesheet"" href=""../Style/font.css"" media=""all"">" & vbCrLf
Response.Write "<script type='text/javascript'>" & vbCrLf
Response.Write "var pc_file = '" & InstallDir & "';" & vbCrLf
Response.Write "var admin_file = '" & AdminFolder & "/';" & vbCrLf
Response.Write "</script>" & vbCrLf
Response.Write "<script type='text/javascript' src='../Js/Admin.js'></script>" & vbCrLf
Response.Write "<script type='text/javascript' src='../../Dialog/main.js'></script>" & vbCrLf
Response.Write "<script type='text/javascript' src='../../Dialog/lhgcore.min.js'></script>" & vbCrLf
Response.Write "<script type='text/javascript' src='../../Dialog/lhgcalendar.min.js'></script>" & vbCrLf
Response.Write "<script language=javascript>" & vbCrlf
Response.Write "var baseurl;" & vbCrlf
Response.Write "baseurl='" & gBaseUrl & "';" & vbCrlf
Response.Write vbCrlf
Response.Write "function openit(str)" & vbCrlf
Response.Write "{" & vbCrlf
Response.Write "var diag = new Dialog({ id: 'OpenIt', title: '浏览', url:'" & gPath & "'+str});diag.onCancel=function(){$DW.close();};diag.show();" & vbCrlf
Response.Write "}" & vbCrlf
Response.Write vbCrlf
Response.Write "function chdir(dir,mode)" & vbCrlf
Response.Write "{" & vbCrlf
Response.Write "var obj;" & vbCrlf
Response.Write "obj=document.webedit;" & vbCrlf
Response.Write "if(!dir)" & vbCrlf
Response.Write "{IsAlert('请输入要浏览的目录');return;}" & vbCrlf
Response.Write "if(mode)" & vbCrlf
Response.Write "{" & vbCrlf
Response.Write "if(obj.filter.value)" & vbCrlf
Response.Write "obj.action='" & gFileName & "?filter='+obj.filter.value+'&path=" & gPath & "'+dir;" & vbCrlf
Response.Write "else" & vbCrlf
Response.Write "obj.action='" & gFileName & "?path=" & gPath & "'+dir;" & vbCrlf
Response.Write "}" & vbCrlf
Response.Write "else" & vbCrlf
Response.Write "{" & vbCrlf
Response.Write "if(obj.filter.value)" & vbCrlf
Response.Write "obj.action='" & gFileName & "?filter='+obj.filter.value+'&path='+dir;" & vbCrlf
Response.Write "else" & vbCrlf
Response.Write "obj.action='" & gFileName & "?path='+dir;" & vbCrlf
Response.Write "}" & vbCrlf
Response.Write "obj.submit();" & vbCrlf
Response.Write "}" & vbCrlf
Response.Write vbCrlf
Response.Write "function edit(name)" & vbCrlf
Response.Write "{" & vbCrlf
Response.Write "ItemDialog('Test','Web Edit','" & InstallDir & "Admin/Admin/Admin_Editfile.asp?act=read&path=" & gPath & "'+name,920,550);" & vbCrlf
Response.Write "}" & vbCrlf
Response.Write vbCrlf
Response.Write "function rename(oldName)" & vbCrlf
Response.Write "{" & vbCrlf
Response.Write "Dialog.prompt('将文件 '+oldName+' 更名为:',function(str){obj=document.webedit;obj.action=baseurl+'&act=renf&from='+oldName+'&to='+str;obj.submit();this.close();},oldName);" & vbCrlf
Response.Write "}" & vbCrlf
Response.Write vbCrlf
Response.Write "function renamed(oldName)" & vbCrlf
Response.Write "{" & vbCrlf
Response.Write "Dialog.prompt('将目录 '+oldName+' 更名为:',function(str){obj=document.webedit;obj.action=baseurl+'&act=rend&from='+oldName+'&to='+str;obj.submit();this.close();},oldName);" & vbCrlf
Response.Write "}" & vbCrlf
Response.Write vbCrlf
Response.Write "function paste()" & vbCrlf
Response.Write "{"
if Session("bufferfile")="" or Session("bufferdir")="" Then 
	Response.Write "IsAlert('剪贴板中没有数据!');"&vbcrlf
	Response.Write "return;"
end if
Response.Write "Dialog.confirm('真要将文件粘贴到此目录吗?', function(){obj=document.webedit;obj.action=baseurl+'&act=paste';obj.submit();}, function(){});" & vbCrlf
Response.Write "}" & vbCrlf
Response.Write vbCrlf
Response.Write "function del()" & vbCrlf
Response.Write "{" & vbCrlf
Response.Write "Dialog.confirm('真要删除选中的目录与文件吗?', function(){obj=document.webedit;obj.action=baseurl+'&act=del';obj.submit();}, function(){});" & vbCrlf
Response.Write "}" & vbCrlf
Response.Write "function mkdir()" & vbCrlf
Response.Write "{" & vbCrlf
Response.Write "Dialog.prompt('新建目录:',function(str){obj=document.webedit;obj.action=baseurl+'&act=md&to='+str;obj.submit();},'');" & vbCrlf
Response.Write "}" & vbCrlf
Response.Write vbCrlf
Response.Write "function selfileall(act)" & vbCrlf
Response.Write "{" & vbCrlf
Response.Write "i=1;" & vbCrlf
Response.Write "obj=document.webedit;" & vbCrlf
Response.Write "while(eval('obj.chidf'+i))" & vbCrlf
Response.Write "{" & vbCrlf
Response.Write "obj1=eval('obj.chidf'+i);" & vbCrlf
Response.Write "obj1.checked=act;" & vbCrlf
Response.Write "i++;" & vbCrlf
Response.Write "}" & vbCrlf
Response.Write "}" & vbCrlf
Response.Write vbCrlf
Response.Write "function seldirall(act)" & vbCrlf
Response.Write "{" & vbCrlf
Response.Write "i=1;" & vbCrlf
Response.Write "obj=document.webedit;" & vbCrlf
Response.Write "while(eval('obj.chidd'+i))" & vbCrlf
Response.Write "{" & vbCrlf
Response.Write "obj1=eval('obj.chidd'+i);" & vbCrlf
Response.Write "obj1.checked=act;" & vbCrlf
Response.Write "i++;" & vbCrlf
Response.Write "}" & vbCrlf
Response.Write "}" & vbCrlf
Response.Write vbCrlf
Response.Write "function doit(act)" & vbCrlf
Response.Write "{" & vbCrlf
Response.Write "i=1;" & vbCrlf
Response.Write "issel=0;" & vbCrlf
Response.Write "obj=document.webedit;" & vbCrlf
Response.Write "while(eval('obj.chidf'+i))" & vbCrlf
Response.Write "{" & vbCrlf
Response.Write "obj1=eval('obj.chidf'+i);" & vbCrlf
Response.Write "if(obj1.checked)" & vbCrlf
Response.Write "{issel=1;break;}" & vbCrlf
Response.Write "i++;" & vbCrlf
Response.Write "}" & vbCrlf
Response.Write "i=1" & vbCrlf
Response.Write "while(eval('obj.chidd'+i))" & vbCrlf
Response.Write "{" & vbCrlf
Response.Write "obj1=eval('obj.chidd'+i);" & vbCrlf
Response.Write "if(obj1.checked)" & vbCrlf
Response.Write "{issel=1;break;}" & vbCrlf
Response.Write "i++;" & vbCrlf
Response.Write "}" & vbCrlf
Response.Write "if(!issel)" & vbCrlf
Response.Write "{IsAlert('请先选择文件与目录。');return;}" & vbCrlf
Response.Write "obj.action=baseurl+'&act='+act;" & vbCrlf
Response.Write "obj.submit();" & vbCrlf
Response.Write "}" & vbCrlf
Response.Write vbCrlf
Response.Write "function refreshit()" & vbCrlf
Response.Write "{" & vbCrlf
Response.Write "obj=document.webedit;" & vbCrlf
Response.Write "obj.action=baseurl;" & vbCrlf
Response.Write "obj.submit();" & vbCrlf
Response.Write "}" & vbCrlf
Response.Write vbCrlf
Response.Write "function upload()" & vbCrlf
Response.Write "{" & vbCrlf
Response.Write "ItemDialog('Upload','上传文件','" & InstallDir & "Admin/Admin/Admin_Upfile.asp?path=" & gPath & "',420,200)" & vbCrLf
Response.Write "}" & vbCrlf
Response.Write vbCrlf
Response.Write "function viewclip()" & vbCrlf
Response.Write "{" & vbCrlf
Response.Write "ItemDialog('Viewclip','查看剪贴板','" & InstallDir & "Admin/Admin/Admin_Viewclip.asp',350,200)" & vbCrLf
Response.Write "}" & vbCrlf
Response.Write vbCrlf
Response.Write "function delit(str)" & vbCrlf
Response.Write "{" & vbCrlf
Response.Write "Dialog.confirm('真要删除文件'+str+'吗?', function(){obj=document.webedit;obj.action=baseurl+'&act=delit&file='+str;obj.submit();}, function(){});" & vbCrlf
Response.Write "}" & vbCrlf
Response.Write vbCrlf
Response.Write "function delitd(str)" & vbCrlf
Response.Write "{" & vbCrlf
Response.Write "Dialog.confirm('真要删除目录'+str+'吗?', function(){obj=document.webedit;obj.action=baseurl+'&act=delitd&file='+str;obj.submit();}, function(){});" & vbCrlf
Response.Write "}" & vbCrlf
Response.Write "</script>" & vbCrlf
Response.Write "</head>" & vbCrlf
Response.Write "<body>" & vbCrlf
Response.Write "<form id=""webedit"" name=""webedit"" method=""post"" action=""" & gBaseUrl & """>" & vbCrlf
Response.Write "<div class=""admin-main layui-anim layui-anim-upbit"">" & vbCrLf
Response.Write "<div class=""table-responsive"">" & vbCrLf
Response.Write "<table class=""layui-table table-hover"">" & vbCrlf
Response.Write "<tr class=""title"">" & vbCrlf
Response.Write "<td height=""32"" colspan=""2"">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;请慎重对文件或目录进行删除操作!</td>" & vbCrlf
Response.Write "<td width=""32"" height=""32"" align=""center""><a href=""javascript:doit('copy');""><img src=""../Images/copy.gif"" width=""32"" height=""32"" alt=""复制选中的文件与目录到剪贴板"" title=""复制选中的文件与目录到剪贴板"" border=""0""></a></td>" & vbCrlf
Response.Write "<td width=""32"" height=""32"" align=""center""><a href=""javascript:doit('cut');""><img src=""../Images/cut.gif"" width=""32"" height=""32"" alt=""剪切选中的文件与目录到剪贴板"" title=""剪切选中的文件与目录到剪贴板"" border=""0""></a></td>" & vbCrlf
Response.Write "<td width=""32"" height=""32"" align=""center""><a href=""javascript:paste();""><img src=""../Images/paste.gif"" width=""32"" height=""32"" alt=""粘贴剪巾板中的文件与目录"" title=""粘贴剪巾板中的文件与目录"" border=""0""></a></td>" & vbCrlf
Response.Write "<td width=""32"" height=""32"" align=""center""><a href=""javascript:refreshit();""><img src=""../Images/refresh.gif"" width=""32"" height=""32"" alt=""刷新"" title=""刷新"" border=""0""></a></td>" & vbCrlf
Response.Write "<td width=""32"" height=""32"" align=""center""><a href=""javascript:del();""><img src=""../Images/del.gif"" width=""32"" height=""32"" alt=""删除选中的文件与目录"" title=""删除选中的文件与目录"" border=""0""></a></td>" & vbCrlf
Response.Write "<td width=""479"" height=""32"">剪贴板状态: "
if Session("bufferdir")<>"" or Session("bufferfile")<>""Then Response.Write "有数据&nbsp;&nbsp;&nbsp;&nbsp;<button type=""button"" class=""layui-btn"" hidefocus=""true"" onClick=""viewclip();"">查看剪贴板</button>":else Response.Write "&nbsp;空&nbsp;":end if
Response.Write "</td>" & vbCrlf
Response.Write "</tr>" & vbCrlf
ok=1
if ok=1 Then
	Response.Write "<tr>" & vbCrlf
	Response.Write "<td colspan=""8"" height=""25"">&nbsp;位置: <input type=""text"" name=""curpath"" style=""width:350"" class=""txt"" value=""" & gPath & """> 过滤显示: <input type=""text"" name=""filter"" style=""width:100"" class=""txt"" value=""" & gFilter & """><button type=""button"" class=""layui-btn"" hidefocus=""true"" onClick=""chdir(document.webedit.curpath.value,0);"">转到</button></td>" & vbCrlf
	Response.Write "</tr>" & vbCrlf
	Response.Write "<tr>" & vbCrlf
	Response.Write "<td height=""365"" valign=""top"" width=""278""> " & vbCrlf
	Response.Write "<table class=""layui-table table-hover"">" & vbCrlf
	Response.Write "<tr align=""right""> " & vbCrlf
	Response.Write "<td height=""25"" valign=""middle"" colspan=""5""><button type=""button"" class=""layui-btn"" hidefocus=""true"" onClick=""seldirall(true);"">全部选择</button><button type=""button"" class=""layui-btn"" hidefocus=""true"" onClick=""seldirall(false);"">清除选择</button><button type=""button"" class=""layui-btn"" hidefocus=""true"" onClick=""mkdir();"">新建</button></td>" & vbCrlf
	Response.Write "</tr>" & vbCrlf
	Response.Write "<tr>" & vbCrlf
	Response.Write "<td height=""25"" valign=""middle"" colspan=""5"">" & vbCrlf
	if gPath<>gRootUrl and gPath<>"/" Then Response.Write "<a href=""javascript:chdir('"&left(gPath,instrRev(gPath,"/",len(gPath)-1))&"',0);"">↑&lt;上一级目录&gt;</a>"
	Response.Write "</td>" & vbCrlf
	Response.Write "</tr>" & vbCrlf
	dim theFolder,cMaxDir
	dim theFile,cMaxCount,iTotleSize,c,iMaxPage
	cMaxDir=0
	for each theFolder in gFolder.SubFolders
		cMaxDir=cMaxDir+1
		Response.Write "<tr>" & vbCrlf
		Response.Write "<td height=""20"" width=""11%"" align=""center"" valign=""middle""><input type=""checkbox"" name=""chidd" & cMaxDir & """ id=""chidd" & cMaxDir & """ value=""" & theFolder.Name & """></td>" & vbCrlf
		Response.Write "<td width=""8%"" align=""center"" valign=""middle""><img src=""../Images/folder.png"" width=""16"" height=""16""></td>" & vbCrlf
		Response.Write "<td width=""51%""><a href=""javascript:chdir('" & theFolder.Name & "',1);"">" & theFolder.Name & "</a></td>" & vbCrlf
		Response.Write "<td width=""16%"" align=""center"" nowrap><a href=""javascript:renamed('" & theFolder.Name & "');"">更名</a></td>" & vbCrlf
		Response.Write "<td width=""14%"" align=""center"" nowrap><a href=""javascript:delitd('" & thefolder.Name & "')"">删除</a></td>" & vbCrlf
		Response.Write "</tr>" & vbCrlf
	next
	c=0
	cMaxCount=0
	iTotleSize=0
	For Each theFile in gFolder.Files
		if procCheckFile(theFile.Name,0)="ok" Then
			cMaxCount=cMaxCount+1
			iTotleSize=iTotleSize+theFile.Size
		end if 
	next
	iMaxPage=cMaxCount\gPageSize+1
	Response.Write "<tr>" & vbCrlf
	Response.Write "<td height=""21"" colspan=""5"">共&nbsp;" & cMaxDir & "&nbsp;个目录&nbsp;<input type=""hidden"" name=""maxdir"" value=""" & cMaxDir & """></td>" & vbCrlf
	Response.Write "</tr>" & vbCrlf
	Response.Write "</table></td>" & vbCrlf
	Response.Write "<td height=""365"" colspan=""7"" valign=""top"">" & vbCrlf
	Response.Write "<table class=""layui-table table-hover"">" & vbCrlf
	Response.Write "<tr align=""right""> " & vbCrlf
	Response.Write "<td height=""25"" valign=""middle"" colspan=""8""><button type=""button"" class=""layui-btn"" hidefocus=""true"" onClick=""selfileall(true);"">全部选择</button><button type=""button"" class=""layui-btn"" hidefocus=""true"" onClick=""selfileall(false);"">清除选择</button><button type=""button"" class=""layui-btn"" hidefocus=""true"" onClick=""upload();"">上传文件</button></td>" & vbCrlf
	Response.Write "</tr>" & vbCrlf
	Response.Write "<tr>" & vbCrlf
	Response.Write "<td height=""25"" valign=""middle"" colspan=""8"">总&nbsp;" & cMaxCount & "&nbsp;个文件&nbsp;第&nbsp;" & gPage & "&nbsp;页&nbsp;共&nbsp;" & iMaxPage & "&nbsp;页&nbsp;" & vbCrlf
	if gPage>1 Then 
		Response.Write "<a href="""&gFileName&"?path="&gPath&"&page="&gPage-1&""">上一页</a>&nbsp;"
	else
		Response.Write "上一页&nbsp;"
	end if 
	if gPage<iMaxPage Then 
		Response.Write "<a href="""&gFileName&"?path="&gPath&"&page="&gPage+1&""">下一页</a>&nbsp;"
	else
		Response.Write "下一页&nbsp;" 
	end if
	Response.Write "&nbsp;第&nbsp;<input type=""text"" name=""fliter2"" style=""width:30""  class=""txt"">&nbsp;页&nbsp;<button type=""button"" class=""layui-btn"" hidefocus=""true"" onClick=""chdir(document.webedit.curpath.value,0);"">转到</button></td>" & vbCrlf
	Response.Write "</tr>" & vbCrlf
	cMaxCount=0
	iTotleSize=0
	For Each theFile in gFolder.Files
		c=c+1
		if cMaxCount>=gPageSize Then 
			exit For
		elseif procCheckFile(theFile.Name,0)="ok" and c>gPageSize*(gPage-1) Then
			iTotleSize=iTotleSize+theFile.Size
			cMaxCount=cMaxCount+1
			Response.Write "<tr>" & vbCrlf
			Response.Write "<td height=""25"" width=""6%"" align=""center"" valign=""middle""><input type=""checkbox"" name=""chidf" & cMaxCount & """ id=""chidf" & cMaxCount & """ value=""" & theFile.Name & """></td>" & vbCrlf
			Response.Write "<td width=""3%"" align=""center"" valign=""middle""><img src=""../Images/" & procGetFormat(theFile.Name) & ".gif"" width=""16"" height=""16""></td>" & vbCrlf
			Response.Write "<td width=""40%""><a href=""javascript:openit('" & theFile.Name & "');"">" & theFile.Name & "</a></td>" & vbCrlf
			Response.Write "<td width=""5%"" align=""center"" nowrap><a href=""javascript:edit('" & theFile.Name & "');"">编辑</a></td>" & vbCrlf
			Response.Write "<td width=""5%"" align=""center"" nowrap><a href=""javascript:rename('" & theFile.Name & "');"">更名</a></td>" & vbCrlf
			Response.Write "<td width=""5%"" align=""center"" nowrap><a href=""javascript:delit('" & theFile.Name & "');"">删除</a></td>" & vbCrlf
			Response.Write "<td align=""right"" width=""11%"">" & theFile.Size & "&nbsp;</td><td width=""25%"">" & theFile.DateLastModified & "</td>" & vbCrlf
			Response.Write "</tr>" & vbCrlf
		end if
	next
	Response.Write "<tr>" & vbCrlf
	Response.Write "<td height=""25"" colspan=""8"">当前共&nbsp;" & cMaxCount & "&nbsp;个文件,共&nbsp;" & iTotleSize\1000 & "&nbsp;K&nbsp;<input type=""hidden"" name=""maxfile"" value=""" & cMaxCount & """></td>" & vbCrlf
	Response.Write "</tr>" & vbCrlf
	Response.Write "</table></td>" & vbCrlf
	Response.Write "</tr>" & vbCrlf
else
	Response.Write "<tr>" & vbCrlf
	Response.Write "<td height=""25"" colspan=""8"" align=""center"">本功能已经被关闭</td>" & vbCrlf
	Response.Write "</tr>" & vbCrlf
end if
Response.Write "</table>" & vbCrlf
Response.Write "</form>" & vbCrlf
Response.Write "</div>" & vbCrLf
Response.Write "</div>" & vbCrLf
Response.Write "</body>" & vbCrlf
Response.Write "</html>"
set gFolder=nothing
Set Fso=nothing
%>